import {defineStore} from "pinia";
import top2 from '@/assets/top2.jpg'
import newshop2 from '@/assets/newshop2.jpg'
export const shopListStore=defineStore("shopListStore",{
    state(){
        return {
             cartList : [
                {
                    id: 1,
                    image:top2,
                    name: '魔方',
                    price: 2.00,
                    quantity: 1,
                    checked: false
                },
                {
                    id: 2,
                    image: newshop2,
                    name: '沙发',
                    price: 6.90,
                    quantity: 1,
                    checked: false
                },
            ]
    }
    },
    actions:{
        setList(list:any){
            this.cartList.push(list)
        },
        getList(){
            return this.cartList
        }
    }
})